﻿@{
    ViewBag.Title = "计划管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section ScriptAndCss{
@*    <style type="text/css">
        .main_left
        {
            border: solid 1px #95B8E7;
        }
    </style>*@
    <link href="@Url.Content("~/Content/css/plan.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        isReportOrPlan = true;
        $(function () {
            $('#quickAccess').tree({
                url: '@(Url.Action("MenuList", "PlanManagement"))',
                onClick: function (node) {
                    var href = $.parseJSON(node.attributes).targetHref;
                    var html = $.get(href, function (res) {
                        $('#center_container').html(res);
                    });
                },

                //默认点击第一个menu
                onLoadSuccess: function (node, data) {
                    $(this).find('.tree-node').first().click();
                }

            });

            window.setTimeout(function () {
                $('#taskCalendar').calendar({
                    fit: true,
                    current: new Date(),
                    weeks: ['日', '一', '二', '三', '四', '五', '六'],
                    months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
                });
            }, 300);


        });
    </script>
}
@{
    var isGlobalUser = (bool)ViewData["IsGlobalUser"];
}
<div style="margin: 3px 0 0 5px;">
    <input type="button" value="创建机房日常计划" onclick="showModuleDialog('/PlanManagement/RoutineInspection')" />
    <input type="button" value="创建第三方计划" onclick="showModuleDialog('/PlanManagement/ThirdPartyInspection')" />
    @if (isGlobalUser)
    {
        <input type="button" value="创建一般计划" onclick="showModuleDialog('/PlanManagement/GeneralPlan')" />
    }
</div>
<div class="width70" style="height: 100%;">
    <div id="center_container" style="height: 90%;">
    </div>
</div>
<div class="width30">
    <div id="taskCalendar" style="height: 300px;">
    </div>
</div>
<script type="text/javascript">
    var formatType = function (value, row, index) {
        var typeList = ["日常机房巡检计划", "第三方巡检计划", "一般计划"];
        return typeList[value * 1 - 1];
    };

    var formatStatus = function (value, row, index) {
        var statusList = ["进行中", "已完成", "已取消", "已关闭"];
        return statusList[value * 1 - 1];
    };

    var formatPlanStatus = function (value, row, index) {
        var statusList = ["未启用", "已启用"];
        return statusList[value * 1];
    };

    var DateFormate = function (value, row, index) {
        if (value) {
            return value.DateStringConvert('yyyy-MM-dd');
        }
    };

    var OverFlagRender = function (value, row, index) {
        if (value == "1") {
            return '<span class="icon-overtip"></span>'
        } else {
            return '<span class="icon-overtip-not"></span>';
        }
    }
</script>
